// @algorithm @lc id=805 lang=cpp 
// @title escape-the-ghosts


#define print(...)
// @test([[1,0],[0,3]],[0,1])=true
// @test([[1,0]],[2,0])=false
// @test([[2,0]],[1,0])=false
// @test([[5,0],[-10,-2],[0,-5],[-2,-2],[-7,1]],[7,7])=false
// @test([[-1,0],[0,1],[-1,0],[0,1],[-1,0]],[0,0])=true
#define MHT(x,y) (abs(x-target[0])+abs(y-target[1]))
class Solution {
public:
    bool escapeGhosts(vector<vector<int>>& ghosts, vector<int>& target) {
        auto dist = MHT(0,0);
        for(auto &g : ghosts)
            if(MHT(g[0], g[1]) <= dist) return false;
        return true;
    }
};